package com.sg.controller.bff;

import com.sg.service.biz.bff.OfficialDocumentService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "OfficialDocument", tags = {"OfficialDocument"})
@RestController
// @RequestMapping("/oms/officialDocument/")
public class OfficialDocumentController {

    @Autowired
    OfficialDocumentService officialDocumentService;

    /**
     * B3查我接收的公文列表
     * gen by moon at 11/12/2023, 10:22:27 PM
     */
    @PostMapping("/oms/officialDocument/queryMyReceiveOfficialDocumentList")
    @ApiOperation(value = "B3查我接收的公文列表", response = OkrResult.class)
    public OkrResult<BffQueryMyReceiveOfficialDocumentListRespDto> queryMyReceiveOfficialDocumentList(@RequestBody(required = false) @Validated BffQueryMyReceiveOfficialDocumentListReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.queryMyReceiveOfficialDocumentList(reqDTO));
    }

    /**
     * B3修改公文
     * gen by moon at 11/12/2023, 10:38:57 PM
     */
    @PostMapping("/oms/officialDocument/updateOfficialDocument")
    @ApiOperation(value = "B3修改公文", response = OkrResult.class)
    public OkrResult<BffUpdateOfficialDocumentRespDto> updateOfficialDocument(@RequestBody(required = false) @Validated BffUpdateOfficialDocumentReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.updateOfficialDocument(reqDTO));
    }

    /**
     * B3查询公文列表
     * gen by moon at 11/12/2023, 10:38:59 PM
     */
    @PostMapping("/oms/officialDocument/queryOfficialDocumentList")
    @ApiOperation(value = "B3查询公文列表", response = OkrResult.class)
    public OkrResult<BffQueryOfficialDocumentListRespDto> queryOfficialDocumentList(@RequestBody(required = false) @Validated BffQueryOfficialDocumentListReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.queryOfficialDocumentList(reqDTO));
    }

    /**
     * B3新增公文
     * gen by moon at 11/13/2023, 5:06:30 PM
     */
    @PostMapping("/oms/officialDocument/addOfficialDocument")
    @ApiOperation(value = "B3新增公文", response = OkrResult.class)
    public OkrResult<BffAddOfficialDocumentRespDto> addOfficialDocument(@RequestBody(required = false) @Validated BffAddOfficialDocumentReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.addOfficialDocument(reqDTO));
    }

    /**
     * B3查询公文详情
     * gen by moon at 11/13/2023, 5:06:40 PM
     */
    @PostMapping("/oms/officialDocument/queryOfficialDocumentDetail")
    @ApiOperation(value = "B3查询公文详情", response = OkrResult.class)
    public OkrResult<BffQueryOfficialDocumentDetailRespDto> queryOfficialDocumentDetail(@RequestBody(required = false) @Validated BffQueryOfficialDocumentDetailReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.queryOfficialDocumentDetail(reqDTO));
    }

    /**
     * B3删除公文
     * gen by moon at 11/17/2023, 12:49:34 PM
     */
    @PostMapping("/oms/officialDocument/deleteOfficialDocument")
    @ApiOperation(value = "B3删除公文", response = OkrResult.class)
    public OkrResult<BffDeleteOfficialDocumentRespDto> deleteOfficialDocument(@RequestBody(required = false) @Validated BffDeleteOfficialDocumentReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.deleteOfficialDocument(reqDTO));
    }

    /**
     * B3查询未安排的公文列表
     * gen by moon at 12/3/2023, 1:15:32 PM
     */
    @PostMapping("/oms/officialDocument/queryUnscheduledOfficialDocList")
    @ApiOperation(value = "B3查询未安排的公文列表", response = OkrResult.class)
    public OkrResult<BffQueryUnscheduledOfficialDocListRespDto> queryUnscheduledOfficialDocList(@RequestBody(required = false) @Validated BffQueryUnscheduledOfficialDocListReqDto reqDTO) {
        return OkrResult.success(officialDocumentService.queryUnscheduledOfficialDocList(reqDTO));
    }
}
